package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.woniuxy.entity.Assignment;

@Mapper
public interface AssignmentMapper {
	//查询所有任务
	@Select("select * from t_assignment")
	public List<Assignment> findAllAssignment();
	
	//根据状态查询任务
	@Select("select * from t_assignment where status=#{status}")
	public List<Assignment>findAssignmentByStatus(int status);
	//模糊查询
	@Select("select * from t_assignment where aname like CONCAT('%',#{words},'%')")
	public List<Assignment>findByWords(String words);
	//新建任务
	@Insert("insert into t_assignment values(default,#{rname},#{rcode},#{status},#{description},#{ctime})")
	public int insertAssignment(Assignment assignment);
}
